using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Easy.Geo.Kml
{    
    public class Document : Container
    {
        public Document() : base() { }
        public Document(string name) : base(name) { }
        public Document(string name, KBool visibility, KBool open) : base(name, visibility, open) { }
        public Document(string name, KBool visibility, KBool open, List<Style> styles)
            : this(name, visibility, open)
        {
            this._styles = styles;
        }
        private List<Style> _styles = new List<Style>();    
        [XmlElement(ElementName="Style",Type=typeof(Style))]
        public List<Style> Styles
        {
            get { return _styles; }
            set { _styles = value; }
        }

        public void AddStyle(Style style)
        {
            this._styles.Add(style);
        }

        public Style AddStyle(string id)
        {
            Style style = new Style(id);
            this.AddStyle(style);
            return style;
        }
    }
}
